home *** CD-ROM | disk | FTP | other *** search
- global gGraphicPath, gFileName, glastline, gkeywordtext, gSelLine, glineoffset, gColor, gBookmark, gSpriteSetList, objGrid, objIndexBtn, objalphabetbtn, objBookmark
-
- on startindex
- set the mouseDownScript to "indexMouseDownScript"
- mStartIndex(objGrid)
- if gSelLine = 0 then
- showKeyword(1, 0)
- else
- showKeyword(gSelLine, 1)
- mDrawKeywords(objGrid, gSelLine)
- end if
- end
-
- on setIndexBtn
- set tMaxKwdFld to 24
- set gSelLine to 0
- set glastline to the number of lines in gkeywordtext
- if gBookmark then
- set objBookmark to birth(script "bookmark_script")
- set objGrid to birth(script "Index_grid_script")
- if glastline > tMaxKwdFld then
- add(gSpriteSetList, [26, 37, 28, 29, 30, 31, 32, 33, 35, 36, 38])
- add(gSpriteSetList, [26, 37, 28, 29, 32, 33, 35, 36, 38])
- else
- add(gSpriteSetList, [26, 37, 28, 29, 32, 33, 35, 36, 38])
- add(gSpriteSetList, [26, 37, 28, 29, 32, 33, 35, 36, 38])
- end if
- else
- set objBookmark to birth(script "120_bookmark_script")
- set objGrid to birth(script "120_Index_grid_script")
- if glastline > tMaxKwdFld then
- add(gSpriteSetList, [26, 37, 28, 29, 30, 31, 32, 33, 35, 36])
- add(gSpriteSetList, [26, 37, 28, 29, 32, 33, 35, 36])
- else
- add(gSpriteSetList, [26, 37, 28, 29, 32, 33, 35, 36])
- add(gSpriteSetList, [26, 37, 28, 29, 32, 33, 35, 36])
- end if
- end if
- set the text of cast 35 to the text of cast 32
- set the text of cast 34 to line 1 to tMaxKwdFld of gkeywordtext
- set pictfilepath to gGraphicPath & getProp(gFileName, #Alphabet)
- blitPictInitFile(objalphabetbtn, pictfilepath)
- end
-
- on killIndexBtn
- blitPictDispose(objIndexBtn)
- blitPictDispose(objalphabetbtn)
- end
-
- on showKeyword lineNumber, switchOn
- set the foreColor of cast 34 to getAt(gColor, 4)
- if glastline > 24 then
- if lineNumber < 3 then
- set glineoffset to 0
- set the text of cast 34 to line 1 to 23 of gkeywordtext & RETURN
- set the visible of sprite 30 to 0
- set the visible of sprite 31 to 1
- updateStage()
- if switchOn then
- set the foreColor of line lineNumber of cast 34 to getAt(gColor, 5)
- end if
- else
- if (lineNumber + 23) > glastline then
- set glineoffset to glastline - 24
- set theText to line glastline - 22 to glastline of gkeywordtext
- set the text of cast 34 to RETURN & theText
- set the visible of sprite 30 to 1
- set the visible of sprite 31 to 0
- updateStage()
- if switchOn then
- set the foreColor of line lineNumber - glineoffset of cast 34 to getAt(gColor, 5)
- end if
- else
- set glineoffset to lineNumber - 2
- set theText to line lineNumber to lineNumber + 21 of gkeywordtext
- set the text of cast 34 to RETURN & theText & RETURN
- set the visible of sprite 30 to 1
- set the visible of sprite 31 to 1
- updateStage()
- if switchOn then
- set the foreColor of line 2 of cast 34 to getAt(gColor, 5)
- end if
- end if
- end if
- else
- set the visible of sprite 30 to 0
- set the visible of sprite 31 to 0
- updateStage()
- set the text of cast 34 to gkeywordtext
- set the foreColor of cast 34 to getAt(gColor, 4)
- if switchOn then
- set the foreColor of line lineNumber of cast 34 to getAt(gColor, 5)
- end if
- end if
- end
-